import config from '@/config';
import RequestBase from '@/utils/request.js';

const baseRequest = new RequestBase(config.safetyUrl);

/** 待办列表 */
export function getToDoTask() {
  return baseRequest.get(`/mobile/bsci/dock/work/to-do-task/list`);
}

/**
 * 查看任务详情
 */
export function getWorkDetail(subWorkId) {
  return baseRequest.get(`/mobile/bsci/dock/work/detail/${subWorkId}`);
}

/**
 * 提交任务
 */
export function workSubmit(data) {
  return baseRequest.put('/mobile/bsci/dock/work/submit', data);
}

/**
 * 审核
 */
export function approveWork(data) {
  return baseRequest.put('/mobile/bsci/dock/work/process', data);
}

/**
 * 任务记录
 * @returns
 */
export function recordList() {
  return baseRequest.get(`/mobile/bsci/dock/work/record/list`);
}

/**
 * 取消任务
 */
export function workCancel(subWorkId) {
  return baseRequest.put(`/mobile/bsci/dock/work/cancel/${subWorkId}`);
}


/**
 * 记录实载重量
 */
export function recordRealLoad(data) {
  return baseRequest.put(`/mobile/bsci/dock/work/record`, data);
}